<template>
    <el-container class="boxmain">
        <el-header>
            <Head :userinfo="userinfo"/>
        </el-header>
        <el-container class="boxsubmain">
            <el-aside width="200px">
                <Menu :userinfo="userinfo"/>
            </el-aside>
            <el-container>
                <el-main>
                    <router-view></router-view>
                </el-main>
                <el-footer>
                    <Foot/>
                </el-footer>
            </el-container>
        </el-container>
    </el-container>
</template>

<script>
import Head from "@/components/head.vue"
import Foot from "@/components/foot.vue"
import Menu from "@/components/sidemenu.vue"
import {getuserinfo} from "@/api"
export default {
    components:{
        Head,
        Foot,
        Menu
    },
    data(){
        return{
            userinfo:null,
        }
    },
    mounted(){
        getuserinfo()
        .then(res=>{
            if(res.type){
                console.log(res.result)
                this.userinfo = res.result
                sessionStorage.setItem("roleid",res.result.roleid)//记录当前权限
                sessionStorage.setItem("username",res.result.username) 
            }
        })
    }
}
</script>

<style lang="scss">
.el-header{
    background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600065020852&di=309beced0af333e8da795641a006ca28&imgtype=0&src=http%3A%2F%2Fbpic.588ku.com%2Fback_pic%2F04%2F79%2F55%2F1558b7e1f254212.jpg);
}
.el-footer{
    background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600065020852&di=309beced0af333e8da795641a006ca28&imgtype=0&src=http%3A%2F%2Fbpic.588ku.com%2Fback_pic%2F04%2F79%2F55%2F1558b7e1f254212.jpg);
}
.el-aside{
    height: 100%;
    background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600065020852&di=309beced0af333e8da795641a006ca28&imgtype=0&src=http%3A%2F%2Fbpic.588ku.com%2Fback_pic%2F04%2F79%2F55%2F1558b7e1f254212.jpg);
}
.boxmain{
    width: 100%;
    height: 100%;
}
.el-submenu,.el-menu-item,.is-disabled{
    width: 200px;
}
</style>